import React,{Component} from 'react';
import {HashRouter as Router,Route,NavLink,Redirect,Switch, withRouter} from 'react-router-dom'
import loadable from '../util/loadable'
const Home = loadable(()=>import('./Home'))
const Food = loadable(()=>import('./Food'))
const Fresh = loadable(()=>import('./Fresh'))
const Menswear = loadable(()=>import('./Menswear'))
const Shoe = loadable(()=>import('./Shoe'))
const Womens = loadable(()=>import('./Womens'))
class Homes extends Component{
    constructor(){
        super();
        this.state={
        }
    }
    componentDidMount(){
    }
    render(){
        return(
            <div>   
                <div className="header-bot">
                    <div className="header-heng-lef">
                        <span>
                        <NavLink
                        to="/Mytaobao/home/home"
                        activeStyle={{
                            fontSize:'0.3rem',
                            fontWeight:'bold',
                            color:'white'
                        }}>首页</NavLink>    
                        </span>
                        <span> 
                            <NavLink
                            to="/Mytaobao/home/Menswear"
                            activeStyle={{
                                fontSize:'0.3rem',
                                fontWeight:'bold',
                                color:'white'
                            }}>男装</NavLink>
                        </span>
                        <span>
                            <NavLink
                            to="/Mytaobao/home/Food"
                            activeStyle={{
                                fontSize:'0.3rem',
                                fontWeight:'bold',
                                color:'white'
                            }}>食品</NavLink>    
                        </span>
                        <span>
                            <NavLink
                            to="/Mytaobao/home/Fresh"
                            activeStyle={{
                                fontSize:'0.3rem',
                                fontWeight:'bold',
                                color:'white'
                            }}>生鲜</NavLink>    
                        </span>
                        <span>
                            <NavLink
                            to="/Mytaobao/home/Womens"
                            activeStyle={{
                                fontSize:'0.3rem',
                                fontWeight:'bold',
                                color:'white'
                            }}>女装</NavLink>    
                        </span>
                        <span>
                            <NavLink
                            to="/Mytaobao/home/Shoe"
                            activeStyle={{
                                fontSize:'0.3rem',
                                fontWeight:'bold',
                                color:'white'
                            }}>鞋靴</NavLink>    
                        </span>
                    </div>
            <div className="header-heng-rig">分类</div></div>
                <Router>
                    <Switch>
                        <Route path="/Mytaobao/home/home" component={Home}></Route>
                        <Route path="/Mytaobao/home/Menswear" component={Menswear}></Route>
                        <Route path="/Mytaobao/home/Food" component={Food}></Route>
                        <Route path="/Mytaobao/home/Fresh" component={Fresh}></Route>
                        <Route path="/Mytaobao/home/Womens" component={Womens}></Route>
                        <Route path="/Mytaobao/home/Shoe" component={Shoe}></Route>
                    </Switch>
                </Router>
            </div>
        )
    }
}
export default withRouter(Homes)